package com.yh.utils.extract.dao;

import com.yh.utils.extract.model.DataSourceDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DataSourceMapper {

    /**
     * 查询全部数据源
     * @Title: queryList
     * @Description:
     * @param
     * @return: List<DataSourceDO>
     * @throws:
     * @author: maliang
     * @Date: 2019/8/8
     */
    List<DataSourceDO> queryList();

    /**
     * 根据ID获取数据源
     * @Title: get
     * @Description:
     * @param id
     * @return: DataSourceDO
     * @throws:
     * @author: maliang
     * @Date: 2019/8/8
     */
    DataSourceDO get(@Param("id") String id);

    /**
     * 插入数据源
     * @Title: save
     * @Description:
     * @param dataSource
     * @return: int
     * @throws:
     * @author: maliang
     * @Date: 2019/8/8
     */
    int save( DataSourceDO dataSource);

    /**
     * 更加key获取数据源
     * @Title: getByKey
     * @Description:
     * @param key
     * @return: DataSourceDO
     * @throws:
     * @author: maliang
     * @Date: 2019/8/8
     */
    DataSourceDO getByKey(@Param("key") String key);

    /**
     * 根据ID删除数据源
     * @Title: deleteByID
     * @Description:
     * @param id
     * @return: int
     * @throws:
     * @author: maliang
     * @Date: 2019/8/8
     */
    int deleteByID(@Param("id") String id);

    public int updateByPrimaryKey(DataSourceDO dataSource) throws Exception;
}
